package com.zj.classwork;
import java.util.Scanner;
public class ClassWork10 {
    public static void main(String[] args) {
        Scanner input=new Scanner(System.in);
        int sum=0;
        for(int i=1;i<=5;i++)
        {
            int count=0;
            System.out.println("欢迎光临第"+i+"家专卖店");

            while (count<3)
            {
                System.out.println("要离开吗（y/n）");
                String value= input.next();
                if ("n".equals(value))
                {
                    System.out.println("买了一件衣服");
                    count++;

                }
                else{
                    System.out.println("离店结账");
                    break;
                }
            }
            sum+=count;




        }
        System.out.println(sum);
    }
}
